/**
  * class CR_Error
  * Aids in the creation of errors. Each error has an assigned enum and message
  * @param {ENUM} description The ENUM value of the error that this error describes
  * @param {Error} error The error that was thrown
  * @param {String} stack The stack trace that exists
  * @param {String} file The file name where this error occured
  */

function CR_Error(description, error, stack, file)
{
    /*** Private Variables ***/

    if(file === undefined)
    {
        file = null;
    }else{
        file = file;
    }

    /*** Public Methods ***/
    return {
        toString : function(){
            var s = "";
            if(file !== null)
            {
                s += file +": ";
            }
            s += description + "\n\n" + error.toString() + "\n\n" + stack;
            return s;
        }
    }
}